/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ronsicecream.pos.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author user
 */
@Entity
@Table(name = "pos_master_type")
@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "PosMasterType.findAll", query = "SELECT p FROM PosMasterType p"),
//    @NamedQuery(name = "PosMasterType.findBySync", query = "SELECT p FROM PosMasterType p WHERE p.sync = :sync"),
//    @NamedQuery(name = "PosMasterType.findByTypeId", query = "SELECT p FROM PosMasterType p WHERE p.typeId = :typeId"),
//    @NamedQuery(name = "PosMasterType.findByTypeName", query = "SELECT p FROM PosMasterType p WHERE p.typeName = :typeName")})
public class PosMasterType implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "type_id")
    private Integer typeId;
    @Column(name = "type_name")
    private String typeName;
    @Lob
    @Column(name = "type_description")
    private String typeDescription;

    public PosMasterType() {
    }

    public PosMasterType(Integer typeId) {
        this.typeId = typeId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getTypeId() {
        return typeId;
    }

    public void setTypeId(Integer typeId) {
        this.typeId = typeId;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public String getTypeDescription() {
        return typeDescription;
    }

    public void setTypeDescription(String typeDescription) {
        this.typeDescription = typeDescription;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (typeId != null ? typeId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosMasterType)) {
            return false;
        }
        PosMasterType other = (PosMasterType) object;
        if ((this.typeId == null && other.typeId != null) || (this.typeId != null && !this.typeId.equals(other.typeId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return typeName;
//        return "com.ronsicecream.pos.entities.PosMasterType[ typeId=" + typeId + " ]";
    }
    
}
